<#include "../common/layout.ftl"/>
<@layout>
<div width="100%" heigth="900px">
	<div class="dxfsqd_title">系统用户</div>
	<div class="dxfsqd_shearch">
	<form method="post" action="/sysUser" class="form-inline" method="POST">
		<label><span>登录账号</span><input type="text" class="input-medium" style="height: 30px"  name="user_name" value="${user_name?if_exists}"/></label> 
		<label><span>城市</span><input type="text" class="input-medium" style="height: 30px"  name="user_city" value="${user_city?if_exists}"/></label> 
		<button type="submit" class="btn btn-success">查询</button>
			<a style="background:green;width: 130px;color: white;" href="/sysUser/add"><i class="icon-user icon-white"></i>添加用户</a>
			<button type="button" class="btn btn-info" onclick="javascript:history.back();">返回</button>
	
	</form>
 </div>

<div class="dxfsqd_table">

	<table class="table table-bordered table-striped">
		<thead>
		  <tr>
			<th  scope="col">ID</th>
			<th scope="col">登录账号</th>
			<th scope="col">公司代码</th>
			<th scope="col">所属城市</th>
			<th scope="col">真实姓名</th>
			<th scope="col">手机号码</th>
			<th scope="col">最近登录时间</th>
			<th scope="col">状态</th>
			<th scope="col">操作记录</th>
			<th scope="col">角色</th>
			<th scope="col">操作</th>
		  </tr>
		</thead>
		<tbody>
		<#list page.list as sysUser>
		  <tr>
			<td>
			  <span class="label">${sysUser.id}</span>
			</td>
			<td>
			 ${sysUser.user_name!""}
			</td>
			<td>
			   ${sysUser.company!"--"}
			</td>
			<td>
				<#list companys as company>
					<#if sysUser.company??>
						<#if company.company == sysUser.company>
							${company.city!""}
						</#if>
					</#if>
				</#list>
			</td>
			<td>
			  ${sysUser.real_name!""}
			</td>
			<td>
			  ${sysUser.cell_phone!""}
			</td>
			<td>
			  ${sysUser.last_login!"--"}
			</td>
			<td>
			  <#if sysUser.lock == 0>
			  	<span class="label label-success">正常</span>
			  <#else>
			  	<span class="label label-inverse">限制登录</span>
			  </#if>
			</td>
			<td>
			   ${sysUser.edit_user!"--"}
			</td>
			<td>
			   <#if sysUser.user_role?exists>
			   	<#if sysUser.user_role=='admin'>
			   		${sysUser.user_role}
			   	<#elseif sysUser.user_role=='seniorManager'>
			   		高级管理员
			   	<#elseif sysUser.user_role=='brandManager'>
			   		品牌管理员
			   	<#elseif sysUser.user_role=='middleManager'>
			   		中层管理员
			   	<#elseif sysUser.user_role=='customerCenter'>
			   		客服中心
			   	<#elseif sysUser.user_role=='entManager'>
			   		企业管理员
			   	</#if>
			   </#if>
			</td>
			<td>
				<div class="btn-group">
					 <#if session.userRole == 'admin'>
					 	<a class="cf" href="/sysUser/editPWD/${sysUser.id}"><i class="icon-info-sign icon-white"></i> 修改密码</a>
					 </#if>
					 <#if session.userRole == 'admin'>
					 	<a class="cf" href="/sysUser/editSysUser/${sysUser.id}"><i class="icon-info-sign icon-white"></i> 修改</a>
					 </#if>
					 <#if session.userRole == 'admin' || session.userRole == 'brandManager'>
					 	<a class="cf" href="/sysUser/delete/${sysUser.id}"><i class="icon-trash icon-white"></i> 删 除</a>
					 </#if>
					 <#if session.userRole == 'admin'>
					 	<#if sysUser.lock==0>
					 		<a class="cf" href="/sysUser/lock/${sysUser.id}"><i class="icon-trash icon-white"></i> 锁定</a>
					 	<#else>
					 		<a class="cf" href="/sysUser/unlock/${sysUser.id}"><i class="icon-trash icon-white"></i> 解锁</a>
					 	</#if>
					 </#if>
				</div>
			</td>
		  </tr>
		</#list>
		</tbody>
	</table>  
	<#include "../common/paginate.ftl" />
	<@paginate currentPage=page.pageNumber totalPage=page.totalPage actionUrl="/sysUser/" />
</div>
</div>
          
</@layout>